package create.he.entity;


import lombok.Data;

@Data
public class JDBCConfig {
	// JDBC 驱动名及数据库URL
	public static final String JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
	/**
	 * 数据库 host
	 */
	private String DB_HOST = "127.0.0.1";
	/**
	 * 数据库 端口
	 */
	private int DB_PROT = 3306;
	/**
	 * 数据库名称
	 */
	private String DB_NAME ="mysql";
	
	private String DB_URL="jdbc:mysql://127.0.0.1:3306/mysql";
	
	// 数据库的用户名与密码，需要根据自己的设置
	private String USER = "root";
	private String PASS = "mysql";

	
	public JDBCConfig() {
		
	}
	/**
	 * 
	 * @param DB_HOST
	 * @param DB_PROT
	 */
	public JDBCConfig(String DB_HOST,int DB_PROT) {
		this.DB_HOST=DB_HOST;
		this.DB_PROT=DB_PROT;
		this.DB_URL = "jdbc:mysql://"+DB_HOST+":"+DB_PROT+"?useSSL=false";
	}
	/**
	 * 
	 * @param USER
	 * @param PASS
	 */
	public JDBCConfig(String USER, String PASS) {
		this.PASS = PASS;
		this.USER = USER;
	}
	/**
	 * 
	 * @param DB_HOST 数据库 host
	 * @param DB_PROT 数据库 端口
	 * @param DB_NAME 数据库名称
	 * @param USER
	 * @param PASS
	 */
	public JDBCConfig(String DB_HOST,int DB_PROT,String DB_NAME,String USER, String PASS) {
		this.DB_HOST=DB_HOST;
		this.DB_PROT=DB_PROT;
		this.DB_NAME=DB_NAME;
		this.PASS = PASS;
		this.USER = USER;
		this.DB_URL = "jdbc:mysql://"+DB_HOST+":"+DB_PROT+"/"+DB_NAME+"?useSSL=false";
	}
}
